﻿#ifndef _COINUPLAYER_H_
#define _COINUPLAYER_H_
#include "cocos2d.h"
#include "ui/CocosGUI.h"
#include "cocostudio/CocoStudio.h"
class CoinUpLayer : public cocos2d::Layer {
public:
	CoinUpLayer();
	static CoinUpLayer* create();
	bool init() override;
	void onExit();//用于保存用户信息
	void initCSBFile();//加载csb文件
	void initUserDefault();//加载用户数据

	void addCoinCoin();//原基础上+100
	void addCoinLevelAndValue();

	void addProfitCoin();//原基础上+100
	void addProfitLevelAndValue();

	int getCoinUpCoinNum() const {
		return coinUpCoinNum;
	}
	int getProfitUpCoinNum() const {
		return profitUpCoinNum;
	}
	cocos2d::ui::Button* getCoinBtn()const {
		return coinUpbtn;
	}
	cocos2d::ui::Button* getProfitBtn()const {
		return profitUpbtn;
	}
	void setCoinUpbtnState(bool flag) {
		coinUpbtnState = flag;
	}
	void setProfitUpbtnState(bool flag) {
		profitUpbtnState = flag;
	}
	bool getCoinUpbtnState()const {
		return coinUpbtnState;
	}
	bool getProfitUpbtnState()const {
		return profitUpbtnState;
	}
private:
	bool coinUpbtnState;
	bool profitUpbtnState;
	cocos2d::Node* rootNode;

	cocos2d::ui::Text* coin_text;
	cocos2d::ui::Text* profit_text;

	cocos2d::ui::TextAtlas* coin_value;
	cocos2d::ui::TextAtlas* profit_value;

	cocos2d::ui::Text* coin_UpCoinNum;
	cocos2d::ui::Text* profit_UpCoinNum;

	cocos2d::ui::Button* coinUpbtn;
	cocos2d::ui::Button* profitUpbtn;

	int coinText;
	int profitText;
	int coinValue;
	int profitValue;
	int coinUpCoinNum;
	int profitUpCoinNum;
};
#endif // !_COINUPLAYER_H_



